<!DOCTYPE html>
<html>

<head>

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>H+ 后台主题UI框架 - 空白页</title>
    <meta name="keywords" content="">
    <meta name="description" content="">
    <link rel="shortcut icon" href="__STATIC__/layout/favicon.ico"> 
    <link href="__STATIC__/layout/css/bootstrap.min.css?v=3.3.6" rel="stylesheet">
    <link href="__STATIC__/layout/css/font-awesome.css?v=4.4.0" rel="stylesheet">
     <!-- jqgrid-->
    <link href="__STATIC__/layout/css/animate.css" rel="stylesheet">
    <link href="__STATIC__/layout/css/style.css?v=4.1.0" rel="stylesheet">
    <link href="__STATIC__/layout/css/plugins/sweetalert/sweetalert.css" rel="stylesheet">
    <link href="__STATIC__/layout/css/gyq.css" rel="stylesheet">
    <link rel="stylesheet" href="__STATIC__/layout/css/demo.css" type="text/css">
</head>

<body style="color:#333;padding:3px;">
    <!-- 标题 -->
    <div class="page-heade">
      <h2 class="title_color text-center">回款管理</h2>
    </div>
    <!-- 标题 -->
    <div>
    <form action="" class="form-inline">
        <table class="table-bordered table" style="margin: 0">
            <tr>
              <td>
                  <button type="button" class="btn-info btn btn-outline" id="add_reMoney">新增回款</button>
                  <span class="lr_5"></span>
                  <a href="Lend_returned_money.html" class="btn-info btn btn-outline" id="Lend_reMoney">导入回款</a>
                  <span class="lr_5"></span>
                  <button class="btn btn-info empty btn-outline" type="button">回收站</button>
              </td>
            </tr>
        </table>
       <table class="row-margin-top tab-content table-bordered table" border="1">
          <tr>
      		<td style="min-width: 120px;width: 120px" class="text-right"><label for="" class="form-label">经销商编号</label></td>
            <td><input type="text" class="form-control" name=""></td>
       		<td style="min-width: 120px;width: 120px"><label for="" class="form-label">经销商名称</label></td>
           <td><input type="text" class="form-control" name=""></td>
             <td style="min-width: 120px;width: 120px"><label for="" class="form-label">回款日期</label></td>
            <td>
            从
             <div class="form-group">
            <input type="text" id="start" class="form-control layer-date " style="min-width:120px;width: 120px;display: inline-block;" name="">
           </div>
            <div class="form-group">
              至
            </div>
           <div class="form-group">
            <input type="text" class="form-control layer-date" style="min-width:120px;width: 120px;display: inline-block;" id="end" name="">
           </div>
            </td>
   		 </tr>
    	<tr>
         
             <td class="text-center" colspan="6">
           <button class="btn btn-info query" >查询</button>
           <button class="btn btn-info emptyIf" type="button">清空查询条件</button>
           <button class="btn btn-info LendExcel" type="button">导出Excel</button>
            </td>
        </tr>
      </table>
     <table class="table table-striped table-bordered table-hover text-center" id="verifytable">
         <tr>
            <th colspan="13"><button class="btn-danger btn" type="button" id="allowSuo">删除</button></th>
         </tr>
          <tr class="info text-center">
            <th style="vertical-align: middle !important;text-align: center;"><input type="checkbox" id="checkAll"></th>
            <th class="text-center">No.</th>
            <th class="text-center">回款日期</th>
            <th class="text-center">经销商编号</th>
            <th class="text-center">经销商名称</th>
            <th class="text-center">回款金额(元)</th>
            <th class="text-center">销售人员</th>
            <th class="text-center">所属分区</th>
            <th class="text-center">所属省份</th>
            <th class="text-center">所属城市</th>
            <th class="text-center">录入人</th>
            <th class="text-center">录入时间</th>
            <th class="text-center">操作</th>
          </tr>
          <tbody>
              <tr>
                  <td align="center"><input type="checkbox" name="items"></td>
                    <td>1</td>
                    <td>2017-04-13</td>
                    <td>CU00110</td>
                    <td>安顺市新城区天金副食经销部</td>
                    <td class="font-bold ObjectNum text-right">22500</td>
                    <td>张三</td>
                    <td>东南大区</td>
                    <td>福建省</td>
                    <td>福州市</td>
                    <td>梁景滔</td>
                    <td>2017-05-12</td>
                    <td><a href="javascript:;" class="modifyTr">修改</a>&nbsp;<a href="javascript:;"  class="delTr">删除</a>&nbsp;<a href="javascript:;" class="seeDetail">查看明细</a></td>
              </tr>
                <tr>
                  <td align="center"><input type="checkbox" name="items"></td>
                    <td>2</td>
                   <td>2017-04-13</td>
                    <td>CU00110</td>
                    <td>安顺市新城区天金副食经销部</td>
                    <td class="font-bold ObjectNum text-right">22500</td>
                    <td>张三</td>
                    <td>东南大区</td>
                    <td>福建省</td>
                    <td>福州市</td>
                    <td>梁景滔</td>
                    <td>2017-05-12</td>
                    <td><a href="javascript:;" class="modifyTr">修改</a>&nbsp;<a href="javascript:;"  class="delTr">删除</a>&nbsp;<a href="javascript:;" class="seeDetail">查看明细</a></td>
              </tr>
               <tr>
                  <td align="center"><input type="checkbox" name="items"></td>
                    <td>3</td>
                   <td>2017-04-13</td>
                    <td>CU00110</td>
                    <td>安顺市新城区天金副食经销部</td>
                    <td class="font-bold ObjectNum text-right">22500</td>
                    <td>张三</td>
                    <td>东南大区</td>
                    <td>福建省</td>
                    <td>福州市</td>
                    <td>梁景滔</td>
                    <td>2017-05-12</td>
                    <td><a href="javascript:;" class="modifyTr">修改</a>&nbsp;<a href="javascript:;" class="delTr">删除</a>&nbsp;<a href="javascript:;" class="seeDetail">查看明细</a></td>
              </tr>
          </tbody>
      </table>
         <h5 class="text-center">
            总共有1条记录，第1/4页，当前页：<input id="page" type="text" style="width: 70px;" value="" class="form-control" /><span id="gopage">GO</span>&nbsp;&nbsp;<span id="fistpage">首页</span>&nbsp;&nbsp; 每页显示
            <select id="pagesize" style="width: 70px" class="form-control">
            <option value='5'>5</option>
            <option value='10'>10</option>
          </select>条
        </h5>

</form>
    </div>
    <!-- 全局js -->
    <script src="__STATIC__/layout/js/jquery.min.js?v=2.1.4"></script>
    <script src="__STATIC__/layout/js/bootstrap.min.js?v=3.3.6"></script>
    <!-- <script src="js/plugins/metisMenu/jquery.metisMenu.js"></script> -->
    <script src="__STATIC__/layout/js/plugins/slimscroll/jquery.slimscroll.min.js"></script>
    <script src="__STATIC__/layout/js/plugins/sweetalert/sweetalert.min.js"></script>
    <script src="__STATIC__/layout/js/plugins/layer/laydate/laydate.js"></script>
    <script src="__STATIC__/layout/js/plugins/layer/layer.min.js"></script>
    <script src="__STATIC__/layout/js/common.js"></script>
    <script>
        //日期范围限制
        var start = {
            elem: '#start',
            format: 'YYYY/MM/DD',
            min: laydate.now(), //设定最小日期为当前日期
            max: '2099-06-16 23:59:59', //最大日期
            istime: true,
            istoday: false,
            choose: function (datas) {
                end.min = datas; //开始日选好后，重置结束日的最小日期
                end.start = datas //将结束日的初始值设定为开始日
            }
        };
        var end = {
            elem: '#end',
            format: 'YYYY/MM/DD',
            min: laydate.now(),
            max: '2099-06-16 23:59:59',
            istime: true,
            istoday: false,
            choose: function (datas) {
                start.max = datas; //结束日选好后，重置开始日的最大日期
            }
        };
        laydate(start);
        laydate(end);
        $(document).ready(function(){
          var $ObjectNum =$(".ObjectNum");
             toNum($ObjectNum);

           $("#allowSuo").click(function() {
            // $("#alert_addNewZone").show();
            var $items = $("[name=items]:checkbox")
            if ($items.filter(':checked').length < 1) {
                sweetAlert("", "请选择需要删除的数据！", "error");
            } else {
              $items.each(function(){ 
                if( $(this).is(':checked')){
                   $(this).parent().parent().remove()
                  }
        }); 
            }
        });
        });

          /*table表格操作*/
      $("#checkAll").click(function() {

            $("[name=items]:checkbox").prop("checked", $(this).prop("checked"));
            if ($("[name=items]:checkbox").prop("checked") != true) {
                // console.log($(this))
                $("[name=items]:checkbox").parents("tr").css("backgroundColor", "#fff")
            } else {
                $("[name=items]:checkbox").parents("tr").css("backgroundColor", "#f8f800")

            }
        })
        $("[name=items]:checkbox").click(function() {
            //定义一个临时变量，避免重复使用同一个选择器选择页面中的元素，提高程序效率
            // console.log(1)
            var $tmp = $("[name=items]:checkbox");
            if ($(this).prop("checked") != true) {
                // console.log($(this))
                $(this).parent().parent().css("backgroundColor", "#fff")
            } else {
                $(this).parent().parent().css("backgroundColor", "#f8f800")

            }
            //用filter()方法筛选出选中的复选框，并直接给CheckedAll赋值
            $("#checkAll").prop('checked', $tmp.length == $tmp.filter(':checked').length);

          });

            /*修改发运数据*/
            $(".modifyTr").click(function(){
                  layer.open({
                   type: 2,
                    skin: 'layui-layer-rim', //加上边框
                   area: ['660px', '500px'], //宽高
                   title:"修改回款数据",
                   content: "{:url('Other/modify_fy_alert')}"
               });
            })
        /*查看明细*/
          $(".seeDetail").click(function(){
                  layer.open({
                   type: 2,
                    skin: 'layui-layer-rim', //加上边框
                   area: ['760px', '500px'], //宽高
                   title:"经销商回款明细",
                   content: "{:url('Other/angency_returned_money_detail')}"
               });
            })
          /*删除*/
          $(".delTr").click(function(){
               var _this=$(this);
              swal({ 
              title: "", 
              text: "您确定要删除这条信息吗？", 
              type: "warning",
              showCancelButton: true, 
              confirmButtonColor: "#DD6B55",
              confirmButtonText: "确定", 
              cancelButtonText: "取消",
              closeOnConfirm: true, 
              closeOnCancel: true
            },function(){
              _this.parent().parent().remove();
            });
        });

      /*新增回款*/
      $("#add_reMoney").click(function(){
         layer.open({
                   type: 2,
                    skin: 'layui-layer-rim', //加上边框
                   area: ['660px', '500px'], //宽高
                   title:"增加回款数据",
                   content:"{:url('Other/add_returnedm_alert')}"
               });
      })
   </script>
</body>

</html>
